﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace HQPad.Models
{
    public class Spell
    {
        public int SpellID { get; set; }

        [ForeignKey("Rules")]
        public int RuleSetID { get; set; }
        public virtual RuleSet Rules { get; set; }

        [Display(Name = "Spell name")]
        [Required(ErrorMessage = "A spell name is required")]
        [MaxLength(50, ErrorMessage = "The spell name is limited to 50 characters")]
        public string Name { get; set; }

        [Display(Name = "Unique spell slug")]
        [Required(ErrorMessage = "A spell slug is required")]
        [MaxLength(50, ErrorMessage = "The spell slug is limited to 50 characters")]
        public string Slug { get; set; }

        public bool Deleted { get; set; }

        [Display(Name = "Last updated")]
        [DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)]
        public DateTime? LastUpdated { get; set; }

        [Display(Name = "Last updated by")]
        public int? LastUpdatedByUserID { get; set; }

        [Display(Name = "Spell description")]
        public string Description { get; set; }

        [Display(Name = "Spell level")]
        public int Level { get; set; }

        public string Range { get; set; }

        public string Duration { get; set; }

        public bool IsExtendable { get; set; }

        public bool IsSpecialist { get; set; }

        public bool IsPrimary { get; set; }

        public bool IsCommon { get; set; }

        /// <summary>The family names groups spells of differing levels, such as all Dumbness spells.</summary>
        [MaxLength(50, ErrorMessage = "The maximum family name is limited to 50 characters")]
        public string Family { get; set; }

        /// <summary>The group name.  Groups spells into a choice group such as Dumbness  levels 1 to 5 int Dumbness 1-5.</summary>
        [MaxLength(50, ErrorMessage = "The maximum group name is limited to 50 characters")]
        public string GroupName { get; set; }

        /// <summary>The url group name slug.</summary>
        [MaxLength(50, ErrorMessage = "The maximum group name slug is limited to 50 characters")]
        public string GroupSlug { get; set; }

        [MaxLength(50, ErrorMessage = "The maximum required group name is limited to 50 characters")]
        public string RequiredGroupName { get; set; }

        [Required(ErrorMessage = "A spell colour is required")]
        [MaxLength(20, ErrorMessage = "The spell colour is limited to 20 characters")]
        [RegularExpression("Black|Blue|Brown|Green|Grey|Red|White|Yellow|All")]
        public string Colour { get; set; }

        [Required(ErrorMessage = "A spell store type is required")]
        [MaxLength(20, ErrorMessage = "The spell store type is limited to 20 characters")]
        [RegularExpression("None|Store|Sorceror|Enchanted")]
        public string StoreType { get; set; }
    }
}